#version 330 core
// vim: set filetype=cpp :vim

uniform mat4 mView;
uniform mat4 mProj;
uniform ivec4 center;

uniform ivec3 p0int;
uniform float umpp;

layout(location=0) in vec3 pos;
out vec3 norm;
out vec3 outPos;
void main(void) {
	vec4 vpos=mView*vec4((center.xyz-p0int)/256.0, 1.0);
	norm=pos;
	if (pos.x==0 && pos.y==0 && pos.z==0){
		norm.z=1;
	}
	gl_Position=mProj*vec4(vpos.xyz/vpos.w+pos*center.w*umpp, 1.0);
}
